#ifndef BPE_PHYSICAL_OBJECT_H
#define BPE_PHYSICAL_OBJECT_H


#include <Irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
#include <boost/shared_ptr.hpp>

#include "../BPEMath/BPEVector3d.h"
#include "../BPEMath/BPEPoint3d.h"

#include "../BPECollision/BPEBoundingBox.h"

#include <vector>
using namespace std;
using namespace boost;

const static double maxSpeedMagnitude = 7 ;

class BPEPhysicsObject{

protected:
	shared_ptr<BPEBoundingShape> boundingShape;
	

	BPEVector3d bpeForce;



	
	vector<BPEVector3d> bpeRotationalForce;
	

	
	BPEVector3d bpeSpeed;
	BPEVector3d bpeRotationalSpeed;
	double mass;



	bool physicsOn;

public:
	BPEPhysicsObject();
	BPEPhysicsObject(const double &mass, const bool& physicsOn);
	void setboundingShape(const shared_ptr<BPEBoundingShape> &bs);

	void setPhysicsOn(const bool &po);
	bool getPhysicsOn();

	double getMass();
	void setMass(const double &m);

	virtual BPEVector3d getPosition() = 0;
	virtual void setPosition(BPEVector3d pos) = 0;

	virtual BPEVector3d getRotation() = 0;
	virtual void setRotation(BPEVector3d rot) = 0;

	void resetAllForces();


	void resetMovementForces();
	void addForce(const BPEVector3d &f);


	void resetRotationalForces();
	void addRotationalForce(const BPEVector3d &f);

	void calculateSpeed();
	void calculateRotationalSpeed();


	void setSpeed(const BPEVector3d &vec);
	BPEVector3d getSpeed();
	void setRotationalSpeed(const BPEVector3d &vec);

	virtual ISceneNode* getNode() = 0;

};


#endif